package com.tnr.scgcxx.controller.safty;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.SessionAttribute;

import com.tnr.scgcxx.dto.CurrUserDto;
import com.tnr.scgcxx.dto.MenuDto;
import com.tnr.scgcxx.service.safty.HomeService;
import com.tnr.scgcxx.utils.Constants;

@RestController
@RequestMapping("/safty")
public class HomeController {
	
	@Resource
	private HomeService homeService;
	
	@GetMapping("/home/menus")
	public List<MenuDto> getMenus(@SessionAttribute(Constants.SESSION_ATTR_NAME_CURR_USER) CurrUserDto currUser){
		
		return homeService.getCurrUserMenus(currUser);
		
	}
}
